package com.mycompany.dao;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

import com.mycompany.model.User;

public class UserDaoImpl extends DaoTemplate implements UserDao{
	private SessionFactory sessionFactory;
	

	@Override
	public void add(User user) {
		Session session = sessionFactory.openSession();
		session.beginTransaction();
		session.save(user);
		session.getTransaction().commit();
		session.close();


	}

	@Override
	public List<User> list() {
		return null;
	}

	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}
	
	

}
